<?php

/*
Process Retire Item (admin_retire_item.pro.php)
*/

$rank_check = 7;
include "../global.inc.php";


$check = fetch("SELECT id,item_value FROM items2 WHERE item_name = '$item_name' AND game = '$game'");

if (!$check[id])
{
	header("Location: admin_retire_item.php?game=$game&error=There+is+no+item+with+that+name!");
}
else
{
	if (!$item_value) { $item_value = round($check[item_value] * 1.25); }
	
	mysql_query("DELETE FROM shop_items2 WHERE item_name = '$item_name' AND game = '$game'");
	mysql_query("UPDATE items2 SET retired=1 WHERE item_name = '$item_name' AND game = '$game'");
	mysql_query("UPDATE items2 SET item_value=$item_value WHERE item_name = '$item_name' AND game = '$game'");	
}

	header("Location: admin_retire_item.php?game=$game&error=The+item+$item_name+has+been+retired!");

?>
